<template>
  <div>
    <h1>Child2 --- {{num}}</h1>
  </div>
</template>

<script>
export default {
  name: "Child2",
  data() {
    return {
      num: 0,
    };
  },
  mounted() {
    this.$root.$on('getNum',(value)=>{
      this.num +=value
    })
  },
};
</script>

<style>
</style>